package com.key.mapper;

import com.key.common.dto.ReceiptDTO;
import com.key.common.vo.AssetsTVO;
import com.key.common.vo.AssetsVO;
import com.key.entity.Assets;
import com.key.entity.ReceiptAssets;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 领用相关的mapper
 * @author wen
 * @create 2023-02-20 10:51
 */
public interface ReceiptAssetsMapper {
    //添加一个领用单据
    int insertReceipt(ReceiptAssets receiptAssets);
    //将领用单据与相关资产关联
    int insertReceiptAndAssets(@Param("receiptNumber") String receiptNumber, @Param("assetsId") long assetsId);
    //依据单号删除
    int deleteReceiptAssetsByReceiptNumber(@Param("receiptNumber") String receiptNumber);

    //修改清单
    int updateReceiptAssets(ReceiptDTO receiptDTO);
    //去除单据与资产的关联
    int updateReceiptAndAssets(@Param("receiptNumber") String receiptNumber);



    //高级查询
    List<ReceiptAssets> selectReceipt(ReceiptDTO receiptDTO);
     //高级查询总数
    int selectReceiptCount(ReceiptDTO receiptDTO);
    //查询所有领用中的的单号资源
    List<ReceiptAssets> selectCanWithdrawalReceiptAssets();
    //依据单号查找领用单
    ReceiptAssets selectReceiptByReceiptAssetsNumber(@Param("receiptNumber") String receiptNumber);
    //根据领用单号查找查询资产
    List<Assets> selectAssetsByReceiptAssetsNumber(@Param("receiptAssetsNumber") String receiptAssetsNumber );
    //根据领用单号查找查询资产
    List<AssetsTVO> selectAssetsTVOByReceiptAssetsNumber(@Param("receiptAssetsNumber") String receiptAssetsNumber );

}
